/**
Company: Sarkar software technologys
WebSite: http://www.sarkar.cn
Author: yeganaaa
Date : 5/16/18
Time: 10:47 AM
 */

package Cn.Sarkar.IMS.Entities

import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.Entities.IMS.*
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.IMS.DataBaseDefinations.BuyOrders
import java.util.*

class BuyOrder(DataContext: IDataContext) : BaseEntity(DataContext, BuyOrders), IBuyOrder {
    var applicationDomainID by BuyOrders.ApplicationDomainID
    override var applicationDomain: IIMSApplicationDomain by hasOne(BuyOrders.ApplicationDomainID) { IMSApplicationDomain(it) }
    var weID by BuyOrders.WeID
    override var we: IOrgan by hasOne(BuyOrders.WeID) { Organ(it) }
    var theyID by BuyOrders.TheyID
    override var they: IOrgan by hasOne(BuyOrders.TheyID) { Organ(it) }
    override var products: Collection<IProduct> = LinkedList()
    override var orderItems: Collection<IOrderItem> = LinkedList()
    var priceTableID by BuyOrders.PriceTableID
    override var price: IPriceTable by hasOne(BuyOrders.PriceTableID) { PriceTable(it) }
    override var state: Int by BuyOrders.State
    var areaID by BuyOrders.AreaID
    override var area: IArea by hasOne(BuyOrders.AreaID) { Area(it) }
}